#ifndef __PROJECT_NAVI_MGR_H__
#define __PROJECT_NAVI_MGR_H__

#include "ttcodeProjectNavi.h"
#include "tinyxml/tinyxml.h"

class ProjectNaviMgr :public PanelProjectNavi
{
protected:
	// Virtual event handlers, overide them in your derived class
	virtual void m_treeCtrlDocumentOnTreeBeginDrag( wxTreeEvent& event );
	virtual void m_treeCtrlDocumentOnTreeBeginLabelEdit( wxTreeEvent& event );
	virtual void m_treeCtrlDocumentOnTreeDeleteItem( wxTreeEvent& event );
	virtual void m_treeCtrlDocumentOnTreeEndDrag( wxTreeEvent& event );
	virtual void m_treeCtrlDocumentOnTreeEndLabelEdit( wxTreeEvent& event );
	virtual void m_treeCtrlDocumentOnTreeItemActivated( wxTreeEvent& event );
	virtual void m_treeCtrlDocumentOnTreeItemRightClick( wxTreeEvent& event );
	virtual void m_treeCtrlDocumentOnTreeSelChanged( wxTreeEvent& event );
	virtual void m_treeCtrlDocumentOnUpdateUI( wxUpdateUIEvent& event );
	virtual void m_treeCtrlTargetOnTreeBeginDrag( wxTreeEvent& event );
	virtual void m_treeCtrlTargetOnTreeBeginLabelEdit( wxTreeEvent& event );
	virtual void m_treeCtrlTargetOnTreeDeleteItem( wxTreeEvent& event );
	virtual void m_treeCtrlTargetOnTreeEndDrag( wxTreeEvent& event );
	virtual void m_treeCtrlTargetOnTreeEndLabelEdit( wxTreeEvent& event );
	virtual void m_treeCtrlTargetOnTreeItemActivated( wxTreeEvent& event );
	virtual void m_treeCtrlTargetOnTreeItemRightClick( wxTreeEvent& event );
	virtual void m_treeCtrlTargetOnTreeSelChanged( wxTreeEvent& event );
	virtual void m_treeCtrlTargetOnUpdateUI( wxUpdateUIEvent& event );

public:
	ProjectNaviMgr( wxWindow* parent);
	~ProjectNaviMgr(){}
		
	void reloadProject( void );
private:
	void createDocumentTree(void);
	void createTargetTree(void);
	wxTreeItemId createTree( wxTreeCtrl *tree,const wxTreeItemId & parent,TiXmlElement* elem);
	void createAllSubTrees( wxTreeCtrl *tree,const wxTreeItemId & parent,TiXmlElement* elem);
	void loadAllImage(void);

};

#include <string>
class NaviTreeViewData: public wxTreeItemData
{
public:
	NaviTreeViewData(const std::string &data):m_Data(data){}
	NaviTreeViewData(const char* data):m_Data(data){}
	std::string getData(void){ return m_Data;}
private:
	NaviTreeViewData();
private:
	std::string m_Data;	
};


#endif // __PROJECT_NAVI_MGR_H__